#include "../../common/asr.hpp"
#include <gflags/gflags.h>

DEFINE_string(api_id, "118939532", "语音平台应用ID");
DEFINE_string(app_key, "rvcP7sDRLijwUEoecJ4RWE7n", "语音平台API密钥");
DEFINE_string(secret_key, "BWKLgLTWJ5amlyYqPP80HsXI46qG6as0", "语音平台加密密钥");

DEFINE_bool(run_mode, false, "程序的运行模式， false-调试； true-发布");
DEFINE_string(log_file, "", "发布模式下，用于指定日志的输出文件");
DEFINE_int32(log_level, 0, "发布模式下，用于指定日志输出等级");

int main(int argc, char* argv[])
{
    google::ParseCommandLineFlags(&argc, &argv, true);
    ChatSystem::InitLogger(FLAGS_run_mode, FLAGS_log_file, FLAGS_log_level);

    ASRClient client(FLAGS_api_id, FLAGS_app_key, FLAGS_secret_key);
    std::string file_content;
    client.get_file_content("16k.pcm", &file_content);
    std::string ret = client.recognize(file_content);
    if(ret.empty())
    {
        return -1;
    }
    std::cout << ret << std::endl;
    return 0;
}
